#include <stdio.h>
int main(void)
{
    int hh, mm;
    printf("Enter a 24-hour time: ");
    scanf("%d:%d", &hh, &mm);
    int stamp = hh * 60 + mm;
    if (stamp < 8 * 60)
        printf("Closet departure time is 8:00 a.m., arriving at 10:16 a.m.\n");
    else if (stamp < 9 * 60 + 43)
        printf("Closet departure time is 9:43 a.m., arriving at 11:52 a.m.\n");
    else if (stamp < 11 * 60 + 19)
        printf("Closet departure time is 11:19 a.m., arriving at 1:31 p.m.\n");
    else if (stamp < 12 * 60 + 47)
        printf("Closet departure time is 12:47 p.m., arriving at 3:00 p.m.\n");
    else if (stamp < 14 * 60)
        printf("Closet departure time is 2:00 p.m., arriving at 4:08 p.m.\n");
    else if (stamp < 15 * 60 + 45)
        printf("Closet departure time is 3:45 p.m., arriving at 5:55 p.m.\n");
    else if (stamp < 19 * 60)
        printf("Closet departure time is 7:00 p.m., arriving at 9:20 p.m.\n");
    else if (stamp < 21 * 60 + 45)
        printf("Closet departure time is 9:45 p.m., arriving at 11:55 p.m.\n");
    else
        printf("Closet departure time is 8:00 a.m., arriving at 10:16 a.m.\n");
    return 0;
}